package com.novellotus.iov.carvice.activity;

import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;

import com.novellotus.iov.carvice.R;
import com.novellotus.iov.carvice.model.ForgotModel;
import com.novellotus.iov.carvice.utils.MyUtils;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 忘记密码
 */
public class ForgotActivity extends BaseActivity {
    @BindView(R.id.btn_code)
    Button btn_code;
    @BindView(R.id.edt_phone)
    EditText edt_phone;
    @BindView(R.id.edt_code)
    EditText edt_code;
    @BindView(R.id.edt_password)
    EditText edt_password;
    @BindView(R.id.btn_sure)
    Button btn_sure;

    ForgotModel forgotModel;

    @Override
    protected void initContentView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_forgot);
    }

    @Override
    public void init() {
        forgotModel = new ForgotModel(this);
        forgotModel.setEditPhone(edt_phone, btn_code);
        forgotModel.setCodeEditText(edt_code);
        forgotModel.setPasswordEditText(edt_password);
        forgotModel.setBtnCode(btn_code, edt_phone);
        forgotModel.setFinishButton(btn_sure, edt_phone, edt_code, edt_password);
        forgotModel.confirm(btn_sure);

    }

    @OnClick(R.id.img_back)
    void back() {
        MyUtils.hideInput(this);
        finish();
    }


}
